package cn.edu.nwsuaf.examcenter.pojo;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * ExamContentId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class ExamContentId implements java.io.Serializable {

	// Fields

	private String examPaperNo;
	private String examItemNo;

	// Constructors

	/** default constructor */
	public ExamContentId() {
	}

	/** full constructor */
	public ExamContentId(String examPaperNo, String examItemNo) {
		this.examPaperNo = examPaperNo;
		this.examItemNo = examItemNo;
	}

	// Property accessors

	@Column(name = "exam_paper_no", nullable = false, length = 50)
	public String getExamPaperNo() {
		return this.examPaperNo;
	}

	public void setExamPaperNo(String examPaperNo) {
		this.examPaperNo = examPaperNo;
	}

	@Column(name = "exam_item_no", nullable = false, length = 50)
	public String getExamItemNo() {
		return this.examItemNo;
	}

	public void setExamItemNo(String examItemNo) {
		this.examItemNo = examItemNo;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof ExamContentId))
			return false;
		ExamContentId castOther = (ExamContentId) other;

		return ((this.getExamPaperNo() == castOther.getExamPaperNo()) || (this
				.getExamPaperNo() != null && castOther.getExamPaperNo() != null && this
				.getExamPaperNo().equals(castOther.getExamPaperNo())))
				&& ((this.getExamItemNo() == castOther.getExamItemNo()) || (this
						.getExamItemNo() != null
						&& castOther.getExamItemNo() != null && this
						.getExamItemNo().equals(castOther.getExamItemNo())));
	}

	public int hashCode() {
		int result = 17;

		result = 37
				* result
				+ (getExamPaperNo() == null ? 0 : this.getExamPaperNo()
						.hashCode());
		result = 37
				* result
				+ (getExamItemNo() == null ? 0 : this.getExamItemNo()
						.hashCode());
		return result;
	}

}